<template>
    <div>
        <van-search v-model="value" show-action placeholder="OPPO A3" @search="onSearch">
            <template #action>
                <div @click="onClickButton"><b>登录</b></div>
            </template>
        </van-search>

        <van-swipe :autoplay="2000" lazy-render>
            <van-swipe-item v-for="image in images" :key="image">
                <img :src="image.image_src" style="width: 100%;" />
            </van-swipe-item>
        </van-swipe>


        <van-grid :border="false" :column-num="4">
            <van-grid-item v-for="(v,i) in list" :key="i">
                <van-image :src="v.image_src?v.image_src:'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg'" />
            </van-grid-item>
        </van-grid>

        <div><img src="../../../img/01.png" alt="" style="width: 100%;margin-top: 2rem;"></div>
        <!-- <div><img src="../../../img/02.png" alt=""></div> -->
    </div>
</template>

<script setup>
import { swiperdataApi , catitemsApi} from '@/api/api';
import { ref } from 'vue';

let images = ref([])
const getters = () => {
    swiperdataApi().then((res) => {
        images.value = res.data.message
        console.log(res);
    })
}
getters()



let list = ref([])
const getlist = () => {
    catitemsApi().then((res) => {
        list.value = res.data.message
        console.log(res);
    })
}
getlist()

</script>

<style lang="scss" scoped></style>